import argot

class DictionaryLoader(object):
    @classmethod
    def getDictionaryStream( cls, name ):
        if not hasattr(cls, 'instance'):
            cls.instance = cls()

        return cls.instance.getStream(name)
    
    @staticmethod
    def getStream( name ):
        try:
            f = open(name, 'rb')
            print 'Opened %s' % name
        except IOError:
            print 'Could not open %s' % name
            return


        def read(size):
            res = f.read(size)
            return res
        
        return read
        #return this.getClass().getResourceAsStream( name )
